package com.example.application4;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MajorActivity extends AppCompatActivity{
    private TextView tv_name;
    private TextView tv_verification;
    private TextView tv_passsword;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.learn_out);
        //获取Intent对象
        Intent intent = getIntent();
        //取出key对应的值
        String name = intent.getStringExtra("name");
        String verification = intent.getStringExtra("verification");
        String password = intent.getStringExtra("password");
        tv_name = (TextView) findViewById(R.id.tv_name);
        tv_verification = (TextView) findViewById(R.id.tv_verification);
        tv_passsword = (TextView) findViewById(R.id.tv_passsword);
        tv_name.setText(name);
        tv_verification.setText(verification);
        tv_passsword.setText(password);
        Button button = (Button) findViewById(R.id.button3);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setAction("android.intent.action.VIEW");
                intent.setData(Uri.parse("http://www.baidu.com"));
                startActivity(intent);
            }
        });
        Button button1 = (Button) findViewById(R.id.button4);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setAction("android.intent.action.VIEW");
                intent.setData(Uri.parse("https://www.bilibili.com"));
                startActivity(intent);
            }
        });
        Button button2 = (Button) findViewById(R.id.button5);
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setAction("android.intent.action.VIEW");
                intent.setData(Uri.parse("https://music.163.com"));
                startActivity(intent);
            }
        });
    }



}
